<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="pageHeader">
    <form id="pagerForm" action="/manage/refund/list.do" method="post"
          onsubmit="return navTabSearch(this);">
        <div class="searchBar">
            <table class="searchContent">
                <tbody>
                <!--分页输入-->
                <input type="hidden" name="pageNum" value="1"/>
                <input type="hidden" name="numPerPage" value="${pageParam.pageSize eq null ? 20 : pageParam.pageSize}"/>
                <input type="hidden" name="payType" value="2"/>
                <tr>
                    <td>
                        商户号：<input name="merchantId" value="${pageParam.merchantId}"/>
                    </td>
                    <td>
                        子商户号：<input name="subMerchantId" value="${pageParam.subMerchantId}"/>
                    </td>
                    <td>
                        原订单号：<input name="oldOrderNo" value="${pageParam.oldOrderNo}"/>
                    </td>
                    <td>
                        原流水号：<input name="oldoRderReqNo" value="${pageParam.oldoRderReqNo}"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        退款流水号：<input name="refundReqNo" value="${pageParam.refundReqNo}"/>
                    </td>

                    <td>
                        <label>支付状态：</label>
                        <select name="status" maxlength="50">
                            <option value="-1">
                                未选择
                            </option>
                            <option value="0"
                                    <c:if test="${pageParam.status eq 0}">selected="selected"</c:if>>初始化
                            </option>
                            <option value="1"
                                    <c:if test="${pageParam.status eq 1 }">selected="selected"</c:if>>退款中
                            </option>
                            <option value="2"
                                    <c:if test="${pageParam.status eq 2 }">selected="selected"</c:if>>退款成功
                            </option>
                            <option value="3"
                                    <c:if test="${pageParam.status eq 3 }">selected="selected"</c:if>>退款失败
                            </option>
                        </select>
                    </td>

                    <td>
                        <label>退款请求时间段：</label>
                        <input class="date valid " datefmt="yyyy-MM-dd HH:mm:ss" name="refundReqDateMin" type="text"
                               maxlength="20"
                               value="${pageParam.refundReqDateMin}"/>至
                        <input class="date valid " datefmt="yyyy-MM-dd HH:mm:ss" name="refundReqDateMax" type="text"
                               maxlength="20"
                               value="${pageParam.refundReqDateMax}"/>
                        </p>
                    </td>

                </tr>
                </tbody>
            </table>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">搜索</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>

<div class="panelBar">

</div>
<table class="table" width="2000" layoutH="160">
    <thead>
    <tr>
        <th style="width:5%">商户号</th>
        <th style="width:5%">子商户号</th>
        <th style="width:5%">原订单号</th>
        <th style="width:5%">原流水号</th>
        <th style="width:5%">退款流水号</th>
        <th style="width:5%">退款日期</th>
        <th style="width:5%">退款金额</th>
        <th style="width:5%">分账明细</th>
        <th style="width:5%">退款类型</th>
        <th style="width:5%">渠道</th>
        <th style="width:5%">退款状态</th>
        <th style="width:5%">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${refunList}" var="refund" varStatus="status">
        <tr>
            <td>
                <div>${refund.merchantId}</div>
            </td>
            <td>
                <div>${refund.subMerchantId}</div>
            </td>
            <td>
                <div>${refund.oldOrderNo}</div>
            </td>
            <td>
                <div>${refund.oldoRderReqNo}</div>
            </td>
            <td>
                <div>${refund.refundReqNo}</div>
            </td>
            <td><fmt:formatDate value="${refund.refundReqDate}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td>
                <div>${refund.transAmt}</div>
            </td>
            <td>
                <div>${refund.ledgerDetail}</div>
            </td>
            <td>
                <div>${refund.payType}</div>
            </td>
            <td>
                <div>${refund.channel}</div>
            </td>
            <td>
                <c:if test="${refund.status eq 3 }">
                    <div style="color:red;"> 退款失败</div>
                </c:if>
                <c:if test="${refund.status eq 2 }">
                    <div style="color:green;"> 退款成功</div>
                </c:if>
                <c:if test="${refund.status eq 1 }">
                    <div style="color:yellowgreen;"> 退款中</div>
                </c:if>
                <c:if test="${refund.status eq 0 }">
                    <div style="color:yellowgreen;"> 初始化</div>
                </c:if>
            </td>
            <td>
                <!--暂无操作 -->
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<!--分页页面组件 -->
<div class="panelBar">
    <div class="pages">
        <span>每页</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <option value="20" ${pageParam.pageSize eq 20 ? 'selected':''}>20</option>
            <option value="50" ${pageParam.pageSize eq 50 ? 'selected':''}>50</option>
            <option value="100" ${pageParam.pageSize eq 100 ? 'selected':''}>100</option>
            <option value="200" ${pageParam.pageSize eq 200 ? 'selected':''}>200</option>
        </select>
        <span>条 , 总记录数: ${pageParam.totalCount} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${pageParam.totalCount}" numPerPage="${pageParam.pageSize}"
         pageNumShown="10" currentPage="${pageParam.pageNum}"></div>
</div>